<template>
    <div class="new_com">
        <div class="model_nav">最新留言</div>
        <ul class="com_ul">
            <li v-for="com in comment" :key="com.id"> 
                <div class="user_log" v-if="!com.user_img">
                    <img src="./../assets/lb01.png" alt="默认用户头像">
                </div>
                <div class="user_log" v-if="com.user_img">
                    <img :src="'http://blog.com/'+com.user_img" alt="默认用户头像">
                </div>
                <div class="com_cont">
                    <div class="user_name">{{com.user_name}}</div>
                    <div class="user_com" v-html="com.content">
                    </div>
                </div>
            </li>
        </ul>
    </div>
</template>

<script>
export default {
    props:['comment'],
    data(){
        return {
            
        }
    }
}
</script>

<style>

.com_ul > li > div{
    float: left;
    margin-left: 8px;
    margin-top: 10px;
    /* border: #212121 1px solid; */
    }
.com_ul > li{
    padding-bottom: 6px;
    border-bottom: 1px solid #a7a7a7;
}
.com_ul > li:last-child{
    border-bottom:none;
}
.com_ul > li::after{
    content: '';
    display: block;
    clear: both;
}
.user_log{
    margin-top: 3px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
}
.user_log img{
    width: 100%;
    height: 100%;
}
.com_cont{
    text-align: left;
    width: 70%;
    overflow: hidden;
}
.user_name{
    height: 20px;
    color: #857f38;
}
.user_com{
    height: 52px;
    width: 100%;
    font-size: 13px;
    /* 多行文本省略号 */
    display: -webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:3;
    overflow:hidden;
}
@media screen and (min-width: 1500px) {
  .com_cont{
    width: 76%;
  }
}
</style>